//
//  ViewController.swift
//  CloudIMTest
//
//  Created by dengwei on 16/1/9.
//  Copyright © 2016年 dengwei. All rights reserved.
//

import UIKit

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        self.title = "好友列表"
        
    }
    
    func messageto(targetid:String,username:String){
        
        let targetid = targetid
        let userName = username
        //新建一个聊天会话View Controller对象
        let chat = RCConversationViewController()//头像圆形
        chat.setMessageAvatarStyle(.USER_AVATAR_CYCLE)
        //设置会话的类型，如单聊、讨论组、群聊、聊天室、客服、公众服务会话等
        chat.conversationType = RCConversationType.ConversationType_PRIVATE
        //设置会话的目标会话ID。（单聊、客服、公众服务会话为对方的ID，讨论组、群聊、聊天室为会话的ID）
        chat.targetId = targetid
        //设置聊天会话界面要显示的标题
        chat.title = userName
        //显示聊天会话界面
        self.navigationController?.pushViewController(chat, animated: true)
        self.tabBarController?.tabBar.hidden = true
    }
    
    @IBAction func addButton1(sender: UIButton) {
        messageto("dengwei",username:"dengwei")
        
    }

    @IBAction func addButton2(sender: UIButton) {
         messageto("dengke",username:"ke er")
        
    }
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    override func viewWillAppear(animated: Bool) {
        self.tabBarController?.tabBar.hidden = false
    }


}

